import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '@/page/Home/HomeView.vue'
import Exchange from '@/page/exchange.vue'
import Settings from '@/page/settings.vue'
import Index from '@/page/index.vue'
import Destroy from '@/page/destroy.vue'
// import More from '@/page/more.vue'
import Invite from '@/page/invite.vue'
import Notice from '@/page/notice.vue'
import StaticRecord from '@/page/staticRecord.vue'
import MyFriend from '@/page/myFriend.vue'
import NoticeDetail from '@/page/noticeDetail.vue'
import WalletAt from '@/page/walletAt.vue'
import WalletGm from '@/page/walletGm.vue'
import DrawRecord from '@/page/drawRecord.vue'
import RechargeRecord from '@/page/rechargeRecord.vue'
import Withdraw from '@/page/withdraw.vue'
import Recharge from '@/page/recharge.vue'
// import AddLp from '@/page/addLp.vue'
import BlockchainGame from '@/page/BlockchainGame/BlockchainGame.vue'
import FriendsList from '@/page/FriendsList.vue'
import FundingDetails from '@/page/FundingDetails.vue'

const routerHistory = createWebHistory()
// const routerHistory = createWebHashHistory()

const routes = [
  {
    path: '/',
    component: HomeView,
  },

  {
    path: '/game',
    component: BlockchainGame,
  },
  {
    path: '/trade',
    component: Index,
  },

  // {
  //   path: '/addLp',
  //   component: AddLp,
  // },
  {
    path: '/exchange',
    component: Exchange,
  },
  {
    path: '/settings',
    component: Settings,
  },
  {
    path: '/destroy',
    component: Destroy,
  },
  // {
  //   path: '/more',
  //   component: More,
  // },
  {
    path: '/invite',
    component: Invite,
  },
  {
    path: '/notice',
    component: Notice,
  },
  {
    path: '/staticRecord',
    component: StaticRecord,
  },
  {
    path: '/myFriend',
    component: MyFriend,
  },
  {
    path: '/noticeDetail',
    component: NoticeDetail,
  },
  {
    path: '/walletAt',
    component: WalletAt,
  },
  {
    path: '/walletGm',
    component: WalletGm,
  },
  {
    path: '/fundingDetails',
    component: FundingDetails,
  },
  {
    path: '/drawRecord',
    component: DrawRecord,
  },
  {
    path: '/rechargeRecord',
    component: RechargeRecord,
  },
  {
    path: '/withdraw',
    component: Withdraw,
  },
  {
    path: '/recharge',
    component: Recharge,
  },
  {
    path: '/friends',
    component: FriendsList,
  },
]

export const router = createRouter({
  history: routerHistory,
  routes: routes,
})

// config router
export function setupRouter(app) {
  app.use(router)
}

// if (!import.meta.env.PROD) {
//   setTimeout(() => {
//     router.push('/trade')
//     setTimeout(() => {
//       router.push('/rechargeRecord?coin=PLAY')
//     }, 1)
//   }, 1)
// }
